I am using DOORS 7.1. |
Re: Convert from ModName_ to Module
Note in DXL Help that for the function module it says: "The first form returns a handle of type Module for itemRef if itemRef is an open module." string ModuleName = "/blaa/blaa/blaa" ModName ModRef = module ModuleName Module Mod = read(fullName ModRef, false)
|
Re: Convert from ModName_ to Module |
Re: Convert from ModName_ to Module SystemAdmin - Sat May 09 06:29:38 EDT 2009
Note in DXL Help that for the function module it says: "The first form returns a handle of type Module for itemRef if itemRef is an open module." string ModuleName = "/blaa/blaa/blaa" ModName ModRef = module ModuleName Module Mod = read(fullName ModRef, false)
Surprisingly, I'm having trouble with the simple task of verifying the existence of two modules. The code looks like this ModName_ aModule = module("/Project name with lots of spaces/folder1/folder2/modulename") ModName_ anotherModule = module("/Project name with lots of spaces/folder with spaces/module with spaces") All I want to do at this point is call exists successfully if (exists(axModule)) logsomething It isn't working. I've tried replacing spaces with underscores and deleting the spaces altogether. The two modules in question are not open, nor should they be. |
Re: Convert from ModName_ to Module SystemAdmin - Mon May 11 13:10:17 EDT 2009
Looking at 'exists' in 'Module information' in the DXL manual, I see it makes a reference to 'the current project'. Very interesting.
//**********************
bool fIsValidModule(string NameMod, string ModType)
{ // Determine if the Module name is a valid module of the specified
// Type "Formal", "Link", or "Descriptive" in the current project.
// Type = "*" means any type (of module).
// 'Valid' modules:
// o Exist and are not deleted.
// o Available for Read to the current user.
// Search rules for 'fFullName' above apply to this function.
if (null NameMod or null ModType) return(false)
bool OKname
string FullName = fFullName(NameMod)
if (null FullName or
!module FullName or
isDeleted(module FullName) or
(ModType != "*" and type(module FullName) != ModType)
)
OKname = false
else OKname = true
// if (!null NameMod and !null ModType)
// print "fIsValidModule: " OKname " '" NameMod "' ^" ModType "^\n"
// else print "fIsValidModule: bad input names\n"
return(OKname)
} // end fIsValidModule()
|
Re: Convert from ModName_ to Module llandale - Mon May 11 18:09:54 EDT 2009
Looking at 'exists' in 'Module information' in the DXL manual, I see it makes a reference to 'the current project'. Very interesting.
//**********************
bool fIsValidModule(string NameMod, string ModType)
{ // Determine if the Module name is a valid module of the specified
// Type "Formal", "Link", or "Descriptive" in the current project.
// Type = "*" means any type (of module).
// 'Valid' modules:
// o Exist and are not deleted.
// o Available for Read to the current user.
// Search rules for 'fFullName' above apply to this function.
if (null NameMod or null ModType) return(false)
bool OKname
string FullName = fFullName(NameMod)
if (null FullName or
!module FullName or
isDeleted(module FullName) or
(ModType != "*" and type(module FullName) != ModType)
)
OKname = false
else OKname = true
// if (!null NameMod and !null ModType)
// print "fIsValidModule: " OKname " '" NameMod "' ^" ModType "^\n"
// else print "fIsValidModule: bad input names\n"
return(OKname)
} // end fIsValidModule()
> Looking at 'exists' in 'Module information' in the DXL manual, I see it makes a reference to 'the current project'. Very interesting. >Louie The module running the script is located in the same project as the other modules. However, getting exists to work is not critical. I have handed my task off to someone with more expertise in DXL as I have succeeded in writing the text parsing portion. |
Re: Convert from ModName_ to Module llandale - Mon May 11 18:09:54 EDT 2009
Looking at 'exists' in 'Module information' in the DXL manual, I see it makes a reference to 'the current project'. Very interesting.
//**********************
bool fIsValidModule(string NameMod, string ModType)
{ // Determine if the Module name is a valid module of the specified
// Type "Formal", "Link", or "Descriptive" in the current project.
// Type = "*" means any type (of module).
// 'Valid' modules:
// o Exist and are not deleted.
// o Available for Read to the current user.
// Search rules for 'fFullName' above apply to this function.
if (null NameMod or null ModType) return(false)
bool OKname
string FullName = fFullName(NameMod)
if (null FullName or
!module FullName or
isDeleted(module FullName) or
(ModType != "*" and type(module FullName) != ModType)
)
OKname = false
else OKname = true
// if (!null NameMod and !null ModType)
// print "fIsValidModule: " OKname " '" NameMod "' ^" ModType "^\n"
// else print "fIsValidModule: bad input names\n"
return(OKname)
} // end fIsValidModule()
Where are the rules in Help on how to form a proper partially qualified name? |
Re: Convert from ModName_ to Module SystemAdmin - Wed Jun 10 19:20:37 EDT 2009 There are no rules in the Help for partially qualified names. After reading what I believe are the rules below, you are likely to conclude that you shouldn't use them in DXL, except perhaps as names displayed to the user. o Partial and Unqualified names are relative to the 'current' folder. Trying to open "MyFolder/MyModule" means there should be a folder named 'MyFolder' in the current folder. To make that happen you may need to set current = fCurr to such a parent folder. o The 'current' folder may change as you open up modules, which may change the 'current' module. o Each slash-separated field of a name must correspond as-is to some item. "MyFolder/MyModule" will NOT match "alsoMyFolder/MyModule" nor "MyFolder/MyModule-1". o While full names are unique in the database, partial and unqualified names are not. o Unqualified names are residual from DOORS v4 days when there were no folders, just a project. Some commands still return unqualified names, but they are now useless (string source(Link) comes to mind). No, generally store such information as either full names or as Project/Folder/Module handles.
|
Re: Convert from ModName_ to Module SystemAdmin - Sat May 09 06:29:38 EDT 2009
Note in DXL Help that for the function module it says: "The first form returns a handle of type Module for itemRef if itemRef is an open module." string ModuleName = "/blaa/blaa/blaa" ModName ModRef = module ModuleName Module Mod = read(fullName ModRef, false)
for modpath in skopenMod do { //key=Ground Segment Spec modpath=/MSV/L2/Ground Segment Spec string srcName=(string key(skopenMod)) string ModuleName= modpath ModName ModRef = module ModuleName Module Mod=read(fullName ModRef,false) close Mod } |
Re: Convert from ModName_ to Module faisal.zahidi@boeing.com - Mon Dec 14 18:52:32 EST 2009
Hi
if (module modpath) {
Module mod = module item modpath
if (!(null mod)) close mod
}
|